/*
 * SvrConfig.h
 *
 *  Created on: 2012-7-11
 *      Author: ThinkPad
 */

#ifndef SVRCONFIG_H_
#define SVRCONFIG_H_

#include "utils.h"

class SvrConfig
{
public:
	SvrConfig();
	~SvrConfig();

	int init();
	int update();
	bool set_authsvr_address();

	int  listen_port;
	char listen_ip[32];

	char log_path[FILE_MAX_PATH];
	int  loglevel;

	char rootpath[FILE_MAX_PATH];
	char virtualpath[FILE_MAX_PATH];

	char pidfilepath[FILE_MAX_PATH];

	char Svr_Name[128];
	int  Svr_Id;
	char listenethname[64];

	char auth_ip[32];
	int auth_port;

	char limit_ip[32];
	char svr_key[128];

	int svr_max_connect_count;

  	/*
	*node type:
	*0:svr node
	*1:center source
	*2:second source
	*3:third source
	*n:the n source
	*/
	int  svrtype;
	int  max_channel;
	BOOL is_make_m3u8_list;
	bool is_save_clip;
	char liverootpath[FILE_MAX_PATH];
	int  store_clip_days;
	char streamconfigfile[FILE_MAX_PATH];

protected:
  void init_config_path(void);
  int SavePid();

private:
  char  configpath[FILE_MAX_PATH];
  char  config_file[FILE_MAX_PATH];
  char  auth_host[FILE_MAX_PATH];
  char  str_buf[FILE_MAX_PATH];
};

#endif /* SVRCONFIG_H_ */
